const { app, Tray, BrowserWindow } = require('electron')
const path = require('path')

app.whenReady().then(() => {
  initTray()
})

function initTray() {
  const tray = new Tray(path.join(__dirname, '../assets/imgs/trayiconTemplate.png'))
  tray.on('drop-files', (e, files) => {
    if (files && files[0]) {
      const win = new BrowserWindow({
        width: 600,
        heigth: 500
      })
      win.loadFile(files[0])
    }
  })
}